<%= kindeditor_javacript_include_tag %>
<div class="pa clearfix">
  <div class="span-p70 colborder">
    <h3><%= @action_title %></h3>
    <div>
      <%= form_for @product, :url => @action, :html => { :multipart => true } do |product| %>
        <p>
          <%= product.label :name,'产品名称', :class => 'block' %>
          <%= product.text_field :name, :class => 'full' %>
        </p>
        <% if @product.avatar.file? %>
        <p>
          <%= image_tag @product.avatar.url(:big) %>
        </p>
        <% end %>
        <p>
          <%= product.label :avatar,'产品头图', :class => 'block' %>
          <%= product.file_field :avatar, :class => 'full' %>
        </p>
        <p>
          <%= product.label :type_id,'种类', :class => 'block' %>
          <%= product.select :type_id, @types.collect {|p| [ p.name, p.id ] } %>
          <%= link_to '新建一个产品种类?', '/types/new' %>
        </p>
        <p>
          <%= product.label :price,'价格', :class => 'block' %>
          <%= product.number_field :price %> 元
        </p>
        <p>
          <%= product.label :discount,'折扣', :class => 'block' %>
          <%= product.number_field :discount %> 折（不填则默认为10，表示不打折）
        </p>
        <p>
          <%= product.label :stock,'库存', :class => 'block' %>
          <%= product.number_field :stock %> 份（不填默认为0）
        </p>
        <p>
          <%= product.label :brief,'简介', :class => 'block' %>
          <%= product.text_area :brief, :rows => 4, :class => 'full height_auto' %>
        </p>
        <div class="ma-bottom">
          <%= product.label :description,'详细介绍', :class => 'block' %>
          <%= product.text_area :description, :id => 'kindeditor', :class => 'full' %>
        </div>
        <p>
          <%= product.submit %>
        </p>
      <% end %>
    </div>
  </div>
  <div class="span-5 last">
    <%= render 'layouts/admin/products_sidebar' %>
  </div>
</div>